import request from '@/router/axios';

export const getList = (page, size, params) => {
  return request({
    url: '/poster/posterPos/list',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}

export const getEditDetail = (params) => {
  return request({
    url: '/poster/posterPos/list',
    method: 'post',
    params: {
      ...params,
    }
  })
}

export const getClassList = () => {
    return request({
        url: '/base/goodsClass/loadInGoodsClassSecond',
        method: 'post'
    })
}
export const remove = (id) => {
  return request({
    url: '/poster/posterPos/delete',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      id,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/poster/posterPos/addItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/poster/posterPos/editItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const changeStatus = (userId, status) => {
  return request({
    url: '/poster/posterPos/changeStatus',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      status
    }
  })
}
//设置档位
export const setUpLadders= (apId, laddersJsonString) => {
  return request({
    url: 'poster/ladder/setUpLadders',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      apId,
      laddersJsonString
    }
  })
}
//档位list
export const getLadders= (apId) => {
  return request({
    url: 'poster/ladder/listManage',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      apId
    }
  })
}

export const getlistPoster = (orderBy,adApId) => {
  return request({
    url: '/poster/poster/listPoster',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      orderBy,adApId
    }
  })
}

